/*
 * @Author: zwz
 * @Date: 2023-05-25 16:48:56
 * @LastEditors: zwz
 * @LastEditTime: 2023-05-27 15:38:55
 * @Description: 请填写简介
 */

const { Service } = require('egg');
class HomeController extends Service {
  async find() {
    // 假如 我们拿到用户 id 从数据库获取用户详细信息
    // 查询
    // const user = await this.app.mysql.select('user');
    // const user = await this.app.mysql.get('user');
    // 用sql 语句去查询
    // const sql = 'select * from user';
    const sql = `INSERT INTO user(name,email,phone,password) VALUES ('周俊杰','zhoujunjie@163.com','123487','0987890')`
    const user = await this.app.mysql.query(sql);
    return user;
  }
}

module.exports = HomeController;
